// PROVIRView.cpp : implementation of the CPizarraView class
//

#include "stdafx.h"

#include "PizarraDoc.h"
#include "PizarraView.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CPizarraView

IMPLEMENT_DYNCREATE(CPizarraView, CPenView)

BEGIN_MESSAGE_MAP(CPizarraView, CPenView)
	//{{AFX_MSG_MAP(CPizarraView)
		// NOTE - the ClassWizard will add and remove mapping macros here.
		//    DO NOT EDIT what you see in these blocks of generated code!
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CPizarraView construction/destruction

CPizarraView::CPizarraView()
{
	// TODO: add construction code here

}

CPizarraView::~CPizarraView()
{
}

BOOL CPizarraView::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	return CPenView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CPizarraView drawing

void CPizarraView::OnDraw(CDC* pDC)
{
	CPizarraDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	// TODO: add draw code for native data here
	CPenView::OnDraw(pDC);
}

/////////////////////////////////////////////////////////////////////////////
// CPizarraView diagnostics

#ifdef _DEBUG
void CPizarraView::AssertValid() const
{
	CPenView::AssertValid();
}

void CPizarraView::Dump(CDumpContext& dc) const
{
	CPenView::Dump(dc);
}

CPizarraDoc* CPizarraView::GetDocument() // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CPizarraDoc)));
	return (CPizarraDoc*)m_pDocument;
}
#endif //_DEBUG

void CPizarraView::Punto(DWORD dwX, DWORD dwY, UINT nPress, UINT nCursor)
{
	CPizarraDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);

	// avisa al documento de que ha llegado un punto nuevo
	pDoc->Punto(dwX, dwY, nPress, nCursor);

	CPenView::Punto(dwX, dwY, nPress, nCursor);
}

void CPizarraView::Nueva() 
{
	WTBorrar();
}

/////////////////////////////////////////////////////////////////////////////
// CPizarraView message handlers

void CPizarraView::OnInitialUpdate() 
{
	CPenView::OnInitialUpdate();
}
